//#include <WiFi.h>
/*-----------wifi sta模式-----------------------------------
const char* ssid = "wang";
const char* password = "12345678";
WiFiServer server(80);
void setup() {
Serial.begin(115200);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.println("Connecting to WiFi..");
}
Serial.println("Connected to the WiFi network");
}
void loop() {
}
-----------------------------------------------------*/

//---------------wifi ap模式
/*
const char *ssid ="wang";
const char *password ="12345678";
WiFiServer server(100);
void setup(){
  Serial.begin(9600);
  WiFi.softAP(ssid,password);
  Serial.println();
  Serial.print("IPaddress:");
  Serial.println(WiFi.softAPIP());
  server.begin();
  Serial.println("server started");
  delay(100);
}

void loop()
{
  WiFiClient client = server.available(); 
  if (client)
  {
    while (client.connected()){
      if (client.available()) {
        char c = client.read();
        if(c == 'L'){
          Serial.print("left");
        }
        if(c == 'R'){
          Serial.print("right");
        }
        //if(buffer.indexOf("\r")>=0)
        //{
          //Serial.print("over");
          //break;
        //}
      }
    }
  }
}

*/



